package homework.extendwork.coding;

public class Work {
    private String strWorkName;
    public static String  fatherName;
    public Work(){
        System.out.println("父类无参构造");
        System.out.println(fatherName);
    }

    static {
        System.out.println("父类静态代码块");
        Work.fatherName="father";
        System.out.println(fatherName);

    }

    {
        System.out.println("父类构造块");
        System.out.println(fatherName);

    }

    public Work(String strWorkName){
        System.out.println("父类有参构造");
        this.setStrWorkName(strWorkName);

    }

    public void showWork(){

        System.out.println("父类 showWork");

    }


    public String getStrWorkName() {
        return strWorkName;
    }

    public void setStrWorkName(String strWorkName) {
        this.strWorkName = strWorkName;
    }
}
